<?php Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl . '/css/app.css'); ?>
<?php Yii::app()->clientScript->registerCssFile('/themes/adminica/css/custom.css'); ?>      
<?php Yii::app()->clientScript->registerCssFile('/themes/adminica/css/theme_white.css'); ?>      
<?php Yii::app()->clientScript->registerCssFile('/themes/adminica/css/header_top.css'); ?>          
<?php Yii::app()->clientScript->registerCssFile('/js/tipTip/tipTip.css'); ?>    
<?php Yii::app()->publishAndRegisterCssFile($_SERVER['DOCUMENT_ROOT'] . '/themes/adminica/css/ui.css'); ?>       
<?php Yii::app()->publishAndRegisterScriptFile($_SERVER['DOCUMENT_ROOT'] . '/js/jquery.qtip2/jquery.qtip.min.js'); ?>
<?php Yii::app()->publishAndRegisterCssFile($_SERVER['DOCUMENT_ROOT'] . '/js/jquery.qtip2/jquery.qtip.min.css'); ?>
<?php Yii::app()->publishAndRegisterScriptFile($_SERVER['DOCUMENT_ROOT'] . '/js/modernizr.custom.39037.js'); ?>
<?php Yii::app()->publishAndRegisterScriptFile($_SERVER['DOCUMENT_ROOT'] . '/js/mustache.js'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <!-- iPhone, iPad and Android specific settings -->
        <meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=1.5" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
        <title><?php echo CHtml::encode($this->pageTitle); ?> - <?php echo Yii::app()->systemName; ?></title>

        <!-- Create an icon and splash screen for iPhone and iPad -->
        <link rel="apple-touch-icon" href="/themes/adminica/images/iOS_icon.png" />
        <link rel="apple-touch-startup-image" href="/themes/adminica/images/iOS_startup.png" />
		<!--        <link rel="stylesheet" media="only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" href="/themes/adminica/css/ipad-portrait.css"/>
				<link rel="stylesheet" media="only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" href="/themes/adminica/css/ipad-landscape.css" />
				<link rel="stylesheet" media="only screen and (min-device-width: 1025px)" href="/themes/adminica/css/ipad-landscape.css" />-->
        <!--[if IE 6]><link rel="stylesheet" type="text/css" href="/themes/adminica/css/ie6.css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" type="text/css" href="/themes/adminica/css/ie.css" media="screen" /><![endif]-->

        <!-- scripts -->
        <script type="text/javascript" src="/themes/adminica/js/uniform/jquery.uniform.min.js"></script>
        <script type="text/javascript" src="/themes/adminica/js/adminica/adminica_ui.js"></script>
        <script type="text/javascript" src="/js/tipTip/jquery.tipTip.minified.js"></script>

        <link rel="stylesheet" href="<?php echo Yii::app()->minScript->generateUrl('combined'); ?>" />

		<?php if (YII_DEBUG == false): ?>
			<script type="text/javascript">
				var _gaq = _gaq || [];
				_gaq.push(['_setAccount', 'UA-25139720-1']);
				_gaq.push(['_trackPageview']);

				(function() {
					var ga = document.createElement('script');
					ga.type = 'text/javascript';
					ga.async = true;
					ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
					var s = document.getElementsByTagName('script')[0];
					s.parentNode.insertBefore(ga, s);
				})();

			</script>
			<!-- Beginning of Asynch Tutorialize Snippet -->
			<script type="text/javascript">
				(function() {
					var tu = document.createElement('script');
					tu.type = 'text/javascript';
					tu.async = true;
					tu.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'dpi1c6z6qg9qf.cloudfront.net/client/v2/tutorialize.js.gz'
					var sc = document.getElementsByTagName('script')[0];
					sc.parentNode.insertBefore(tu, sc);
				})();
				var _t = _t || [];
				_t.push = function() {
					if (typeof window.tutorialize !== 'undefined') {
						window.tutorialize.process(arguments[0]);
					}
					return Array.prototype.push.apply(this, arguments);
				};
				_t.push({publisher_id: '520cee3b4e5fe133b6002f42'});

				<?php if (Yii::app()->user->isAuthenticatedUser): ?>
					_t.push({user_id: '<?php echo Yii::app()->user->id; ?>'});
				<?php endif; ?>
			</script>
			<!-- End of Tutorialize Snippet -->
		<?php endif; ?>
    </head>

	<?php
	$iPad = strpos($_SERVER['HTTP_USER_AGENT'], 'iPad');
	?>
    <body id="<?php echo $this->id . '-' . $this->action->id; ?>" orient="portrait" style="min-height: 420px; min-width: 320px">
        <div id="wrapper" class="<?php echo ($iPad ? "ipad" : ""); ?>">
			<?php echo $content; ?>
        </div>
    </body>
</html>